home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 04 January 1999
- //
- // Add string items to the end of a string array . A new string array
- // with the string items added is returned. Note that all of the input
- // and output string arrays may contain duplicate string items.
- //
- // flags:
- // string[] $items
- // A list of string values to add to the string array.
- //
- // string[] $list
- // A list of string values.
- //
- // returns:
- // string[] : Merged string array.
- //
- // examples:
- // string $array1[] = `sphere`;
- // // Result: nurbsSphere1 makeNurbSphere1 //
- // string $array2[] = `sphere`;
- // // Result: nurbsSphere2 makeNurbSphere2 //
- // string $sphereList[] = AWAppendStringsToStringArray($array1, $array2);
- // // Result: nurbsSphere2 makeNurbSphere2 nurbsSphere1 makeNurbSphere1 //
- //
- // Note: Use stringArrayAppend instead of this script
- //
- global proc string [] AWAppendStringsToStringArray(
- string $items[],
- string $list[])
- {
- string $item, $listItem, $result[];
- int $resultIndex = 0;
-
- // Copy the items currently in the list.
- //
- for ($listItem in $list) {
- $result[$resultIndex++] = $listItem;
- }
-
- // Add the new items to the list.
- //
- for ($item in $items) {
- $result[$resultIndex++] = $item;
- }
-
- // Return the new list.
- //
- return $result;
- }
-
-